// tft显示演示代码
#include <cupeTFT.h>

void CupeTFT::init()
{
  tft.init();

  randomSeed(millis());
}

void CupeTFT::loop()
{
  uint16_t color = random(0xFFFF);

  unsigned long start;
  int n, i, i2,
      cx = tft.width() / 2,
      cy = tft.height() / 2;

  tft.fillScreen(BLACK);
  n = min(tft.width(), tft.height());
  start = micros();
  for (i = 2; i < n; i += 6)
  {
    i2 = i / 2;
    tft.drawRect(cx - i2, cy - i2, i, i, color);
  }
  delay(500);
}
